<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
var a = true;
// 1. 使用instanceof来检测
console.log(a instanceof Array);
// 2. Array.isArray(数据)
console.log(Array.isArray(a));

// 3. 函数借调
var s = Object.prototype.toString.call(a);
console.log(s);
</script>
</body>
</html>
<!--
typeof 检测出来的类型:
number, string, boolean, undefined, object, function

-->